番薯动漫[漫].js.bak 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. var rule = {
  2. 类型: '影视',
  3. title: '番薯动漫[漫]',
  4. host: 'https://www.fsdm02.com',
  5. url: '/vodshow/fyclass--------fypage---.html',
  6. searchUrl: '/vodsearch/**----------fypage---.html',
  7. filterable: 1,
  8. headers: {
  9. 'User-Agent': `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/${(537+Math.random()*2).toFixed(2)} (KHTML, like Gecko) Chrome/${Math.floor(90+Math.random()*40)}.0.0.0 Safari/537.36`,
  10. 'X-Forwarded-For': `116.25.${Math.floor(Math.random()*255)}.${Math.floor(Math.random()*255)}`,
  11. 'Referer': 'https://www.fsdm02.com/'
  12. },
  13. class_parse: `js:
  14. let html = request(HOST);
  15. let $ = jsp.createParser(html);
  16. let classes = [];
  17. $('.nav-menu li:not(:contains("首页")) a').each(function(){
  18. let name = $(this).text().trim();
  19. let href = $(this).attr('href');
  20. let typeId = href.match(/vodshow\\/(\\d+)/)[1];
  21. classes.push(name + '$' + typeId);
  22. });
  23. CLASS = classes.join('#');
  24. `,
  25. 推荐: `js:
  26. let d = [];
  27. let html = request(HOST);
  28. let $ = jsp.createParser(html);
  29. $('.module-item').each(function(){
  30. let it = $(this);
  31. d.push({
  32. title: it.find('.title').text() || it.find('img').attr('alt'),
  33. img: it.find('img').attr('data-original') || it.find('img').attr('src'),
  34. desc: it.find('.remarks').text(),
  35. url: it.find('a').attr('href')
  36. });
  37. });
  38. setResult(d);
  39. `,
  40. 一级: {
  41. title: '.vod-item .title&&Text',
  42. img: 'img&&data-original',
  43. desc: '.remarks&&Text',
  44. url: 'a&&href'
  45. },
  46. 二级: {
  47. title: 'h1&&Text; .tag&&Text',
  48. img: '.detail-img&&data-original',
  49. desc: `js:
  50. let info = [];
  51. $('.info-item').each(function(){
  52. let text = $(this).text().replace(/\\s+/g,'');
  53. if(text) info.push(text);
  54. });
  55. info.join(' · ');
  56. `,
  57. content: '.desc&&Text',
  58. tabs: '.play-source-tab&&a',
  59. lists: `.episode-list:eq(#id) a`,
  60. prepend: `js:
  61. let playFrom = [];
  62. $('.play-source-tab a').each(function(){
  63. playFrom.push($(this).text().trim());
  64. });
  65. setPlayFrom(playFrom);
  66. `
  67. },
  68. 搜索: `js:
  69. let d = [];
  70. let html = request(input);
  71. let $ = jsp.createParser(html);
  72. $('.search-item').each(function(){
  73. let it = $(this);
  74. d.push({
  75. title: it.find('.title').text(),
  76. img: it.find('img').attr('data-src'),
  77. desc: it.find('.info').text(),
  78. url: it.find('a').attr('href')
  79. });
  80. });
  81. setResult(d);
  82. `,
  83. lazy: `js:
  84. let html = request(input);
  85. let encryptedData = html.match(/var player_data\\s*=\\s*'(.*?)'/)[1];
  86. // AES解密核心
  87. let decrypt = (data) => {
  88. let key = CryptoJS.MD5('fsdm@2024').toString();
  89. let iv = CryptoJS.enc.Utf8.parse(key.substr(16,16));
  90. let bytes = CryptoJS.AES.decrypt(data, CryptoJS.enc.Utf8.parse(key), {iv});
  91. return bytes.toString(CryptoJS.enc.Utf8);
  92. };
  93. let playUrl = decrypt(encryptedData);
  94. input = { parse:0, url: playUrl };
  95. `,
  96. proxy_rule: `js:
  97. if(/(m3u8|mp4)/.test(input.url)){
  98. input.url = buildProxyUrl(input.url, {
  99. headers: {
  100. 'X-Real-IP': '118.25.'+(Math.random()*255|0)+'.'+(Math.random()*255|0)
  101. }
  102. });
  103. }
  104. `,
  105. antiBot: `js:
  106. // 过5秒盾验证
  107. if(html.includes('安全检查')){
  108. let challenge = html.match(/id="challenge-form" action="(.*?)"/)[1];
  109. let params = {
  110. jschl_vc: html.match(/name="jschl_vc" value="(.*?)"/)[1],
  111. pass: html.match(/name="pass" value="(.*?)"/)[1],
  112. jschl_answer: calculateAnswer(html)
  113. };
  114. await sleep(5000);
  115. let verifyHtml = post(HOST + challenge, {body: params});
  116. rule.headers.Cookie = verifyHtml.headers['Set-Cookie'];
  117. }
  118. `
  119. }